java jlabel border

98

java jlabel border -

textLabel.setBorder(BorderFactory.createLineBorder(Color.YELLOW, 5));

java jlabel border -

JLabel textLabel = new JLabel("Welcome Child",SwingConstants.CENTER);
textLabel.setForeground(Color.YELLOW);
textLabel.setBorder(BorderFactory.createLineBorder(Color.YELLOW, 5));

JPanel textPanel = new JPanel(new GridBagLayout());
textPanel.add(textLabel);
textPanel.setPreferredSize(new Dimension(300, 100));

frame.getContentPane().add(textPanel, BorderLayout.CENTER);

Comments

Submit
0 Comments